﻿package mortal.game.view.lotteryDraw
{
    import Message.Public.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import extend.language.*;
    import flash.events.*;
    import flash.text.*;
    import mortal.common.global.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;

    public class LotteryDrawActiveTipView extends GSprite
    {
        private var _bg1:ScaleBitmap;
        private var _bg2:ScaleBitmap;
        private var _tipImg1:GImageBitmap;
        private var _tipImg2:GImageBitmap;
        private var _valueTxt:GTextFiled;
        private var _getOutButton:GButton;
        private var _exchangeButton:GButton;
        private var _numImg1:GImageBitmap;
        private var _numImg2:GImageBitmap;
        private var _numImg3:GImageBitmap;

        public function LotteryDrawActiveTipView()
        {
            return;
        }// end function

        public function updateData() : void
        {
            var _loc_1:* = Cache.instance.pack.backPackCache.getItemCountByCategoryAndType(EGroup._EGroupProp, EProp._EPropProp, EPropType._EPropTypeSell);
            this._valueTxt.text = _loc_1.toString();
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._bg1 = UIFactory.bg(0, 0, 195, 30, this, ImagesConst.TipBg);
            this._bg2 = UIFactory.bg(430, 0, 195, 30, this, ImagesConst.TipBg);
            this._tipImg1 = UIFactory.gImageBitmap(ImagesConst.LotteryDrawActiveGetProp, 10, 0, this);
            this._tipImg2 = UIFactory.gImageBitmap(ImagesConst.LotteryDrawActiveOwnProp, 440, 0, this);
            this._valueTxt = UIFactory.gTextField("5000", 520, 2, 50, 20, this, GlobalStyle.textFormatHuang2.setSize(13));
            this._valueTxt.autoSize = TextFieldAutoSize.LEFT;
            this._getOutButton = UIFactory.gButton(Language.getString(20346), 545, 3, 45, 22, this, "GreenLinkButton");
            this._getOutButton.configEventListener(MouseEvent.CLICK, this.onGetOutClickHandler);
            this._exchangeButton = UIFactory.gButton(Language.getString(41553), 580, 3, 45, 22, this, "GreenLinkButton");
            this._exchangeButton.configEventListener(MouseEvent.CLICK, this.onExchangeClickHandler);
            this._numImg1 = UIFactory.gImageBitmap(ImagesConst.LotteryDrawActiveGetNum, 145, 75, this);
            this._numImg2 = UIFactory.gImageBitmap(ImagesConst.LotteryDrawActiveGetNum, 430, 75, this);
            this._numImg3 = UIFactory.gImageBitmap(ImagesConst.LotteryDrawActiveGetNum, 495, 105, this);
            this.pushUIToDisposeVec(this._bg1);
            this.pushUIToDisposeVec(this._bg2);
            this.pushUIToDisposeVec(this._tipImg1);
            this.pushUIToDisposeVec(this._tipImg2);
            this.pushUIToDisposeVec(this._valueTxt);
            this.pushUIToDisposeVec(this._exchangeButton);
            this.pushUIToDisposeVec(this._numImg1);
            this.pushUIToDisposeVec(this._numImg2);
            this.pushUIToDisposeVec(this._numImg3);
            return;
        }// end function

        private function onGetOutClickHandler(event:MouseEvent) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.LotteryDrawPackageShow));
            return;
        }// end function

        private function onExchangeClickHandler(event:MouseEvent) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.LotteryOpenExchengePanel, 3));
            return;
        }// end function

    }
}
